package com.linjiahao.vod.client;

import com.linjiahao.vod.service.VideoService;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "TestDirectQueue")
public class DirectReceiver {

    @Autowired
    private VideoService videoService;

    @RabbitHandler
    public void process(String videoId) {
        System.out.println(videoId);
        videoService.removeVideo(videoId);
    }

}